package Registration;

import java.sql.ResultSet;
import java.sql.SQLException;
import dbmanager.DBManager;
import dbmanager.GetIdName;

public class DebugWithText
{
	DBManager db;
	GetIdName gin ;
	public DebugWithText() 
	{
		db = new DBManager();
		db.getConnect();
		gin = new GetIdName(db);
	}
	public void addText(int fromId) 
	{
		ResultSet rs = db.getSelect("Select * from property_details where id="+fromId+" order by id");
	//	ResultSet rs = db.getSelect("SELECT * FROM property_details where  mid = 9675;");
		try 
		{
			while(rs.next())
			{
				String id = rs.getString("id");
				String MidText = "no$";
				
				String PidText = "no$";
				String PvText = "no$";
				String RefText = "no$";
				try 
				{
					MidText = gin.getItem(rs.getString("mid"));
					PidText = gin.getItem(rs.getString("pid"));
					PvText = gin.getItem(rs.getString("pv"));
					RefText = gin.getItem(rs.getString("ref"));
				} catch (Exception e) {
				}
				db.getUpdate("update property_details set midtext='"+MidText+"', pidtext='"+PidText+"', pvtext='"+PvText+"', Reftext='"+RefText+"' where id='"+id+"' ");
			}
		}
		catch (Exception e) {
		}
	}
	public static void main(String[] args) 
	{
		int i;
		DebugWithText debug= new DebugWithText();
		for(i=89770;i<=89923;i++)
		{
			debug.addText(i);
		}
	}
}